package com.songcha.library_database_sakura.greendao;


import com.songcha.library_database_sakura.LibraryDatabaseSakuraApplication;

public class GreenDaoManager {
    @kotlin.jvm.Volatile
    private static GreenDaoManager instance;
    private HomeCacheBeanDao mHomeCacheDao;
    private SearchHistoryBeanDao mSearchHistoryDao;
    private VideoPlayProgressBeanDao mVideoPlayProgressDao;
    private HomeScheduleCacheBeanDao mHomeScheduleCacheDao;
    private HomeBannerCacheBeanDao mHomeBannerCacheDao;
    private WordStarBeanDao mWordStarDao;

    public static GreenDaoManager getInstance( ){
        if(instance==null){
            synchronized (GreenDaoManager.class){
                if(instance==null){
                    instance=new GreenDaoManager();
                }
            }
        }
        return instance;
    }

    private GreenDaoManager(){
        mHomeCacheDao= LibraryDatabaseSakuraApplication.Companion.getDaoSession().getHomeCacheBeanDao();
        mSearchHistoryDao= LibraryDatabaseSakuraApplication.Companion.getDaoSession().getSearchHistoryBeanDao();
        mVideoPlayProgressDao= LibraryDatabaseSakuraApplication.Companion.getDaoSession().getVideoPlayProgressBeanDao();
        mHomeScheduleCacheDao= LibraryDatabaseSakuraApplication.Companion.getDaoSession().getHomeScheduleCacheBeanDao();
        mHomeBannerCacheDao= LibraryDatabaseSakuraApplication.Companion.getDaoSession().getHomeBannerCacheBeanDao();
        mWordStarDao= LibraryDatabaseSakuraApplication.Companion.getDaoSession().getWordStarBeanDao();
    }

    public HomeCacheBeanDao getHomeCacheDao(){return mHomeCacheDao;}

    public SearchHistoryBeanDao getSearchHistoryDao(){
        return mSearchHistoryDao;
    }

    public VideoPlayProgressBeanDao getVideoPlayProgressDao(){
        return mVideoPlayProgressDao;
    }

    public HomeScheduleCacheBeanDao getHomeScheduleCacheDao(){
        return mHomeScheduleCacheDao;
    }

    public HomeBannerCacheBeanDao getHomeBannerCacheDao(){return mHomeBannerCacheDao;}

    public WordStarBeanDao getWordStarDao(){return mWordStarDao;}

}
